﻿using System;
using System.IO;
using System.Web;
using System.Web.UI.HtmlControls;
using AnyOffice.Components;
namespace AnyOffice.general.file_folder
{
    public partial class edit : System.Web.UI.Page
    {
        public string _filename = string.Empty;
        public string _path = string.Empty;
        public string _username = string.Empty;
        public bool isppt;
        public bool isword;
        public string url = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            string s = (Request.QueryString["filename"] != null) ? Request.QueryString["filename"].ToString() : "";
            this.url = "readdisk.aspx?filename=" + Server.UrlEncode(s);
            this._path = s;
            s = s.Replace("../", "");
            string str2 = "/attachment/file_folder/" + HttpContext.Current.User.Identity.Name;
            FileInfo info = new FileInfo(Server.MapPath(str2 + s));
            this._filename = info.Name;
            if (this._filename.ToLower().EndsWith(".doc") || this._filename.ToLower().EndsWith(".docx"))
            {
                this.isword = true;
            }
            if (this._filename.ToLower().EndsWith(".ppt") || this._filename.ToLower().EndsWith(".pptx"))
            {
                this.isppt = true;
            }
            this._username = new UserCache().UserName;
        }
    }
}
